//
//  DLWWeChatShareManager.h
//  DGGBaseSDK
//
//  Created by DL_hzk on 2018/6/7.
//  Copyright © 2018年 DL. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UMShare/UMShare.h>

typedef NS_ENUM(NSUInteger, DLWWeChatShareCustomPlatformType);

typedef NS_ENUM(NSUInteger,WWXShareCallBackStatusType){
    WWXShareCallBackStatusTypeSuccess = 0,//分享成功
    WWXShareCallBackStatusTypeCancel = 1,//分享取消
    WWXShareCallBackStatusTypeFail = 2,//分享失败
};

@class DLWWeChatShareManager;
@protocol SharedMesaageDelegate<NSObject>

/**
 * 分享结果回调
 */
- (void)dl_sharedMessageCallBack:(BOOL)success responseData:(UMSocialShareResponse *)response error:(NSError *)error;

/**
 * 分享结果回调 带状态
 */
- (void)dl_wwxsharedMessageCallBackStatusType:(WWXShareCallBackStatusType)statusType responseData:(UMSocialShareResponse *)response error:(NSError *)error;

/**
 * 分享面板显示或者隐藏回调
 */
- (void)dl_sharedMenuViewDisPlay:(BOOL)show;

/**
 * 检测用户是否配置了自定义分享，如有，请调用（dl_shareAddCustomePlatform:iconImage:platformName:）方法添加并实现回调
 */
- (void)dl_shareCustomeConfigCheck:(DLWWeChatShareManager *)shareManager;

/**
 * 用户自定义分享，点击分享按钮回调
 */
- (void)dl_shareCustomePlatform:(DLWWeChatShareCustomPlatformType)platform withUserInfo:(NSDictionary *)userInfo;

@end

@interface DLWWeChatShareManager : NSObject

@property (nonatomic, weak) id<SharedMesaageDelegate> delegate;

@property (nonatomic, strong) void(^dl_sharedMessageCallBack)(BOOL success, UMSocialShareResponse *response, NSError *error);

///分享回调带状态
@property (nonatomic, copy) void(^dl_shareMessageWithStatusCallBack)(WWXShareCallBackStatusType callBackStatusType,UMSocialShareResponse*response,NSError *error);

@property (nonatomic, strong) void(^dl_sharedMenuViewDisPlayBlock)(BOOL isShow);

+ (instancetype)sharedInstance;

@property (nonatomic, assign) BOOL customWxShareUI;

/**
handle open url
*/
- (BOOL)dl_handleOpenURL:(NSURL *)theURL;

#pragma mark - 分享
/**
 分享网页信息（已废弃，勿调用）
 @param platformType 分享平台
 @param url 网页地址
 @param thumbURL 缩略图
 @param title 网页标题
 @param content 网页标题内容
 */
- (void)dl_shareToWX:(UMSocialPlatformType)platformType
         withMediaURL:(NSString *)url
             thumbURL:(NSString *)thumbURL
                title:(NSString *)title
              content:(NSString *)content;

/**
 分享网页信息
 @param url 网页地址
 @param thumbURL 缩略图
 @param title 网页标题
 @param content 网页标题内容
 */
- (void)dl_shareWithMediaURL:(NSString *)url
             thumbURL:(NSString *)thumbURL
                title:(NSString *)title
              content:(NSString *)content;

/**
 用户添加自定义分享平台
 @param platformType 分享平台
 @param iconImage icon图片
 @param platformName 平台名称
 */
- (void)dl_shareAddCustomePlatform:(DLWWeChatShareCustomPlatformType)platformType
                          iconImage:(UIImage *)iconImage
                       platformName:(NSString *)platformName;

/// 直接分享图片到微信
/// @param image 分享的图片
- (void)dgg_shareImageToWXPlatformImage:(UIImage *)image;

@end
